// @ts-ignore
/* eslint-disable */
import { OpenApi as request } from "@/utils/request";

/** 小程序路由分页 GET /platform/config */
export async function listPage11(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listPage11Params,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageRespPlatformMiniProgramRoutesVo>(
    `/barter-user/platform/config`,
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 新增小程序路由 POST /platform/config */
export async function add12(
  body: API.PlatformMiniProgramRoutesDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>(`/barter-user/platform/config`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 小程序路由详情 GET /platform/config/${param0} */
export async function detail16(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.detail16Params,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponsePlatformMiniProgramRoutesVo>(
    `/barter-user/platform/config/${param0}`,
    {
      method: "GET",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 编辑小程序路由 PUT /platform/config/${param0} */
export async function edit4(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.edit4Params,
  body: API.PlatformMiniProgramRoutesDto,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(
    `/barter-user/platform/config/${param0}`,
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      params: { ...queryParams },
      data: body,
      ...(options || {}),
    }
  );
}

/** 删除小程序路由 DELETE /platform/config/${param0} */
export async function del12(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.del12Params,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(
    `/barter-user/platform/config/${param0}`,
    {
      method: "DELETE",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 小程序路由全部 GET /platform/config/all */
export async function all7(options?: { [key: string]: any }) {
  return request<API.BaseResponseListPlatformMiniProgramRoutesVo>(
    `/barter-user/platform/config/all`,
    {
      method: "GET",
      ...(options || {}),
    }
  );
}
